package com.zimmur.platform.common.utils;
/**
 * 数字工具类
 * @Description
 * @author zcx
 * @time 2017年11月15日 下午5:18:39
 */
public class NumberUtil {
	/**
	 * 判断当前字符串是否为整数（此方法只能判断是否为正整数）
	 * 
	 * @param str
	 * @return Boolean
	 */
	public static Boolean isNum(String str) {
		boolean flag = str.matches("[0-9]+"); 
		return flag;
	}
	/**
	 * 是否为null或0
	 * @param num
	 * @return
	 */
	public static boolean isEmpty(Integer num){
		return num==null || num==0;
	}
	/**
	 * 比较俩个数字是否相等
	 * @param a
	 * @param b
	 * @return
	 */
	public static boolean compareAWithB(int a,int b){
		
		return a == b;
	}
	public static boolean compareAWithB(int a,long b){
		
		return a == b;
	}
	public static boolean compareAWithB(int a,byte b){
		
		return a == b;
	}
	public static boolean compareAWithB(int a,short b){
		
		return a == b;
	}
	public static boolean compareAWithB(short a,short b){
		
		return a == b;
	}
	public static boolean compareAWithB(short a,byte b){
		
		return a == b;
	}
	public static boolean compareAWithB(short a,long b){
		
		return a == b;
	}
	public static boolean compareAWithB(byte a,byte b){
		
		return a == b;
	}
	public static boolean compareAWithB(byte a,long b){
		
		return a == b;
	}
	public static boolean compareAWithB(long a,long b){
		
		return a == b;
	}
}
